{include file="public/header" /}
<body>
<style>
    .cion{
        display: inline-block;
        width: 120px;
    }
</style>
<nav class="breadcrumb"><i class="Hui-iconfont">&#xe67f;</i> 首页
    <span class="c-gray en">&gt;</span> 报告统计
    <span class="c-gray en">&gt;</span> 商品报表
    <a class="btn btn-success radius r" style="line-height:1.6em;margin-top:3px" href="/report/shop" title="刷新" ><i class="Hui-iconfont">&#xe68f;</i></a>
    <a class="btn btn-success radius r" style="line-height:1.6em;margin-top:3px;margin-right: 10px"  id="daochu" title="&nbsp;&nbsp;导出&nbsp;&nbsp;" >导出</a>
</nav>
<div class="page-container">
    <form  method="get" action="" id="qfrom">
        <div class="text-c">
            创建时间：
            <input type="text" onfocus="WdatePicker()" value="{:input('get.start')}" name="start" id="datemin" class="input-text Wdate" style="width:120px;" autocomplete="off">
            -
            <input type="text" onfocus="WdatePicker()" value="{:input('get.end')}" name="end" id="datemax" class="input-text Wdate" style="width:120px;" autocomplete="off">

            <span class="select-box" style="width: 100px;">
                <select name="gid" class="select">
                    <option value="0">全部商品</option>
                    {foreach $goods as $v}
                        {if isset($_GET['gid']) && $v.id ==  $_GET['gid']}
                        <option value="{$v.id}" selected>{$v.name}</option>
                        {else/}
                        <option value="{$v.id}">{$v.name}</option>
                        {/if}
                    {/foreach}

                </select>
            </span>
            <button type="submit" class="btn btn-success">搜索</button>
        </div>
    </form>

    <div class="cl pd-5 bg-1 bk-gray mt-20">
        <span class="l">
        </span>
        <span class="r">共有数据：<strong>{$list->total()}</strong> 条</span> </div>
    <table class="table table-border table-bordered table-hover table-bg">
        <thead>
        <tr>
            <th scope="col" colspan="11">商品报表</th>
        </tr>
        <tr class="text-c">
            <th width="30">标识</th>
            <th width="80">日期</th>
            <th width="100">商品</th>
            <th width="80">出售总数</th>
            <th width="80">质押总数</th>
            <th width="200">本日待售</th>
            <th width="80">转让中</th>
            <th width="100">统计时间</th>
        </tr>
        </thead>
        <tbody>
        {foreach $list as $v}
        <tr class="text-c">
            <td>{$v.id}</td>
            <td>{$v.tdate}</td>
            <td>{$v.gid}-{$v.gname}</td>
            <td>{$v.sell_num}</td>
            <td>{$v.zy_num}</td>
            <td>{$v.today_sell}（其中换购{$v.ex_num}:平台放单{$v.sys_num}:用户订单{$v.out_num}:）</td>
            <td>{$v.trans_num}</td>
            <td>{$v.time}</td>
        </tr>
        {/foreach}
        </tbody>
    </table>
    <div class="page">
        {$list->render()|raw}
    </div>
</div>

{include file="public/footer" /}

<script type="text/javascript">
    $("#daochu").bind("click",function () {
        window.location.href="/report/shopexcel.html?"+$("#qfrom").serialize()

    })
</script>